Some fixes from Morten Welinder (#172947):
authorMatthias Clasen <mclasen@redhat.com>
Thu, 7 Apr 2005 18:46:19 +0000 (18:46 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 7 Apr 2005 18:46:19 +0000 (18:46 +0000)
2005-04-07  Matthias Clasen  <mclasen@redhat.com>

Some fixes from Morten Welinder (#172947):

* gtk/updateiconcache.c (icon_name_hash): Make this compiler-
and platform-independent.
(is_cache_up_to_date): Don't compare mtimes is a stat call failed.
(build_cache): Error out if a stat fails.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/updateiconcache.c

index 0eb9670405f62a9a21a0541ee45394307e6c75c7..77d725f8d5b138ab4ce4c5777bc4bb0d315d56bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-04-07  Matthias Clasen  <mclasen@redhat.com>
+
+       Some fixes from Morten Welinder (#172947):
+       
+       * gtk/updateiconcache.c (icon_name_hash): Make this compiler- 
+       and platform-independent.
+       (is_cache_up_to_date): Don't compare mtimes is a stat call failed.
+       (build_cache): Error out if a stat fails.  
+
 2005-04-07  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_expander_column): Add 
index 0eb9670405f62a9a21a0541ee45394307e6c75c7..77d725f8d5b138ab4ce4c5777bc4bb0d315d56bc 100644 (file)
@@ -1,3 +1,12 @@
+2005-04-07  Matthias Clasen  <mclasen@redhat.com>
+
+       Some fixes from Morten Welinder (#172947):
+       
+       * gtk/updateiconcache.c (icon_name_hash): Make this compiler- 
+       and platform-independent.
+       (is_cache_up_to_date): Don't compare mtimes is a stat call failed.
+       (build_cache): Error out if a stat fails.  
+
 2005-04-07  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_expander_column): Add 
index 0eb9670405f62a9a21a0541ee45394307e6c75c7..77d725f8d5b138ab4ce4c5777bc4bb0d315d56bc 100644 (file)
@@ -1,3 +1,12 @@
+2005-04-07  Matthias Clasen  <mclasen@redhat.com>
+
+       Some fixes from Morten Welinder (#172947):
+       
+       * gtk/updateiconcache.c (icon_name_hash): Make this compiler- 
+       and platform-independent.
+       (is_cache_up_to_date): Don't compare mtimes is a stat call failed.
+       (build_cache): Error out if a stat fails.  
+
 2005-04-07  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_expander_column): Add 
index 82aa18d539ba91423b56a564c66ac8a4eb68f937..d7e8867b52d4c51e6de61b7db4403e5d40a0c984 100644 (file)
@@ -71,7 +71,7 @@ is_cache_up_to_date (const gchar *path)
   retval = g_stat (cache_path, &cache_stat);
   g_free (cache_path);
   
-  if (retval < 0 && errno == ENOENT)
+  if (retval < 0)
     {
       /* Cache file not found */
       return FALSE;
@@ -385,8 +385,8 @@ struct _HashNode
 static guint
 icon_name_hash (gconstpointer key)
 {
-  const char *p = key;
-  guint h = *p;
+  const signed char *p = key;
+  guint32 h = *p;
 
   if (h)
     for (p += 1; *p != '\0'; p++)
@@ -992,8 +992,9 @@ build_cache (const gchar *path)
 
   /* Update time */
   /* FIXME: What do do if an error occurs here? */
-  g_stat (path, &path_stat);
-  g_stat (cache_path, &cache_stat);
+  if (g_stat (path, &path_stat) < 0 ||
+      g_stat (cache_path, &cache_stat))
+    exit (1);
 
   utime_buf.actime = path_stat.st_atime;
   utime_buf.modtime = cache_stat.st_mtime;